//
//  Unit.h
//  MapEdit
//
//  Created by Steven Canfield on 6/27/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "UnitDoodad.h"

@interface Unit : NSObject {
	chk_unit_t * unit;
	int frameNumber;
}

/* Initializer */
- (id)initWithData:( chk_unit_t * )u;
+ (Unit *)unitWithData:(chk_unit_t *)u;

/* Identifier ( Unit Serial Number ) */
- (u_int32_t)identifier;

/* Unit Location */
- (NSPoint)location;
- (void)setLocation:(NSPoint)point;

/* Unit Type */
- (u_int16_t)type;
- (void)setType:(u_int16_t)type;

/* Unit Type */
- (u_int8_t)owner;
- (void)setOwner:(u_int8_t)owner;

/* Health / Shields Energy */
- (u_int8_t)health;
- (void)setHealth:(u_int8_t)health;
- (u_int8_t)maxHealth;
- (BOOL)healthValid;

- (u_int8_t)shield;
- (void)setShield:(u_int8_t)shield;
- (u_int8_t)maxShield;
- (BOOL)shieldValid;

- (u_int8_t)energy;
- (void)setEnergy:(u_int8_t)energy;
- (u_int8_t)maxEnergy;
- (BOOL)energyValid;

/* Resources */
- (u_int32_t)resource;
- (void)setResource:(u_int32_t)resource;
- (BOOL)resourceValid;

/* Properties */
- (BOOL)cloaked;
- (BOOL)cloakedValid;
- (void)setCloaked:(BOOL)flag;

- (BOOL)hallucinated;
- (BOOL)hallucinatedValid;
- (void)setHallucinated:(BOOL)flag;

- (BOOL)burrowed;
- (BOOL)burrowedValid;
- (void)setBurrowed:(BOOL)flag;

- (BOOL)invincible;
- (BOOL)invincibleValid;
- (void)setInvincible:(BOOL)flag;

- (int)frameNumber;
- (void)setFrameNumber:(int)fn;
@end
